{{!-- 
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
--}}
<h3 class="wrap-header bold"> Reports </h3>

<div class="wrap non-collapsible ">
	<h3 class="wrap-header reportSearchHeader">Search Criteria
		<span class="label label-yellow pull-right" data-js="searchResult"></span>
	</h3>
	<div class="wrap well ">
		<div class="row-fluid">
			<div class="span12">
				<div class="form-horizontal">
					<div class="span12">
						<div class="pull-right">
							<i class="icon-info-sign searchInfoUserAccess" title="Search Filter Hints"
							   data-id="searchInfo"></i>
						</div>
						<div class="control-group">
							<div class="span4">
								<label class="control-label">Policy Name</label>
								<div class="controls">
									<input type="text" name="policyName" data-js="policyName" autofocus placeholder="Enter Policy Name">
								</div>
							</div>
							<div class="span4 reportSearchInfoInputs">
								<label class="control-label control-label-align" for="policyType">Policy Type</label>
								<div class="controls controls-margin">
									<input type="text" data-id="policyType">
								</div>
							</div>
						</div>
						<div class="control-group">
							<div class="span4">
								<label class="control-label" for="component">Component</label>
								<div class="controls">
									<input type=text data-id="component" name="componentType">
								</div>
							</div>
							<div class="span4 reportSearchInfoInputs">
								<label class="control-label control-label-align">Resource</label>
								<div class="controls controls-margin">
									<input type="text" name="resourceName" data-js="resourceName" placeholder="Enter Resource Name">
								</div>
							</div>
						</div>
						<div class="control-group">
							<div class="span4">
								<label class="control-label" for="policyLabels">Policy Label</label>
								<div class="controls">
									<input type=text data-id="policyLabels" name="policyLabels">
								</div>
							</div>
							<div class="span4 reportSearchInfoInputs">
								<label class="control-label control-label-align" for="zoneName">Zone Name</label>
								<div class="controls controls-margin">
									<input type=text data-id="zoneName" name="zoneName">
								</div>
							</div>
						</div>
						<div class="control-group search-by">
							<label class="control-label">Search By</label>
							<div class="controls" data-js="searchBy">
								<div class="">
									<div class="btn-group">
										<button class="btn dropdown-toggle" data-toggle="dropdown">
											<span>Group</span>
											<span class="caret"> </span>
										</button>
										<ul class="dropdown-menu">
											<li>
												<a data-id="grpSel" class="autoText" href="javascript:;">Group</a>
											</li>
											<li>
												<a data-id="userSel" class="autoText" href="javascript:;">Username</a>
											</li>
										</ul>
									</div>
									<input type="text" data-js="selectGroups">
									<input type="text" style="display: none" data-js="userName">
								</div>
							</div>
						</div>


					</div>
					<div>
						<div class="control-group">
							<div class="controls">
								<button type="button" class="btn btn-primary btn-small" data-js="searchBtn"
										name="searchPolicy">
									<i class="icon-search"></i>
									Search
								</button>
							</div>
						</div>
					</div>
				</div>
			</div>

		</div>
	</div>
	<div class="row-fluid">
	<span>
		<div class="btn-group btn-right">
			<button type="button" data-name="downloadFormatBtn" class="btn btn-primary dropdown-toggle"
					title="Export all below policies" data-toggle="dropdown">
				<i class="icon-external-link-sign"></i>
				<span>Export</span>
				<span class="caret"> </span>
			</button>
			<ul class="dropdown-menu download-list">
				<li><a data-id="xlsFormat" class="downloadFormat" href="javascript:void(0)">Excel file</a></li>
				<li role="separator" class="divider"></li>
				<li><a data-id="csvFormat" class="downloadFormat" href="javascript:void(0)">CSV file</a></li>
                {{#showExportJson}}
                    <li role="separator" class="divider"></li>
                    <li><a data-id="jsonFormat" class="downloadFormat" href="javascript:void(0)">JSON file</a></li>
                {{/showExportJson}}
			</ul>
		</div>
	</span>
		<a href="javascript:void(0)" data-id="downloadReport"></a>
	</div>
	<div class="row-fluid">
		{{#each policyHeaderList}}
		<h3 class="wrap-header bold reportSearchHeader" data-js="hdfsHeader" data-compHeader="{{this.serviceDefName}}">
			{{capitaliseLetter this.serviceDefName}}
			<span class="label label-yellow btn-right" data-js="hdfsSearchResult"></span>
		</h3>
		<div class="wrap well position-relative" data-comp="{{this.serviceDefName}}">
			<div data-id="{{this.collName}}" class="hdfs-table showMoreLess"></div>
		</div>
		{{/each}}
	</div>
</div>